package com.beiming.libra.common.enums;

/**
 * 案件状态
 *
 * @Author: zhangqi
 */
public enum ArbitrationCaseStatusEnum {

  APPLY_REVIEW("00", "申请立案", 0),
  APPLY_CANCEL("09", "取消申请", 0),
  APPLY_REJECT("02", "不予立案", 0),
  APPLY_MODIFY("03", "补正立案", 0),
  APPLY_SUC("04", "立案成功", 1),
  PAID("11", "已缴费", 2),
  UNPAID_FAIL("19", "未缴费撤案", 3),
  EXECUTE_TOOK_ARBITRATOR("20", "已指定仲裁员", 2),
  EXECUTE_JUSTIFY_OVER("21", "用户举证质证答辩期结束", 2),
  EXECUTE_ARBITRATOR_QUE("22", "仲裁员问题单", 2),
  EXECUTE_ARBITRATOR_QUE_OVER("23", "仲裁员问题单结束", 2),
  CC_ARBITRATOR_REVIEW_SUC("30", "仲裁员结案审核通过", 4),
  CC_SECRETARY_REVIEW_SUC("31", "办案秘书结案审核通过", 4),
  CC_LEADER_REVIEW_SUC("32", "领导结案审核通过", 4),
  FILE_APP("40", "归档申请", 4),
  FILE_REVIEW_SUC("41", "归档审核通过", 4),
  MODIFY_CASE_USER("50", "用户追加当事人，变更代理人", 2),
  ADJUST_APP("60", "用户申请调解", 2),
  WITHDRAW_CASE_APP("90", "用户申请撤案", 5),
  WITHDRAW_CASE_ARBITRATOR_REVIEW_SUC("91", "仲裁员撤案审核通过", 5),
  WITHDRAW_CASE_SECRETARY_REVIEW_SUC("92", "办案秘书撤案审核通过", 5),
  WITHDRAW_CASE_LEADER_REVIEW_SUC("93", "领导撤案审核通过", 5),
  WITHDRAW_CASE_FINANCIAL_SUC("94", "财务退款审核通过", 5),
  WITHDRAW_CASE_LEADER_MONEY_REVIEW_SUC("95", "领导退款审核通过", 5);

  private String code;
  private String name;
  private Integer groupId;

  ArbitrationCaseStatusEnum(String code, String name, Integer groupId) {
    this.code = code;
    this.name = name;
    this.groupId = groupId;
  }

  /**
   * 通过code获取name
   */
  public static String getName(String index, int groupId) {
    try {
      for (ArbitrationCaseStatusEnum e : ArbitrationCaseStatusEnum.values()) {
        if (e.getCode().equalsIgnoreCase(index) && e.getGroupId() == groupId) {
          return e.name;
        }
      }
    } catch (Exception e) {
    }
    return null;
  }

  /**
   * 通过code获取GroupId
   */
  public static Integer getGroupId(String index) {
    try {
      for (ArbitrationCaseStatusEnum e : ArbitrationCaseStatusEnum.values()) {
        if (e.getCode().equalsIgnoreCase(index)) {
          return e.groupId;
        }
      }
    } catch (Exception e) {
    }
    return null;
  }

  public String getCode() {
    return code;
  }

  public String getName() {
    return name;
  }

  public Integer getGroupId() {
    return groupId;
  }
}
